package cfs.controller;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import cfs.model.CustomerDAO;
import cfs.model.EmployerDAO;
import cfs.model.Model;

/**
 * Servlet implementation class LoginController
 */
public class LogoutAction extends Action {
	CustomerDAO userDAO;
	EmployerDAO employeeDAO;

	/**
	 * @param model
	 * @see HttpServlet#HttpServlet()
	 */
	public LogoutAction(Model model) {
		super();
		userDAO = model.getCustomerDao();
		employeeDAO = model.getEmployerDao();
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return "logout.do";
	}

	@Override
	public String perform(HttpServletRequest request) {
		HttpSession session = request.getSession(false);
		session.setAttribute("user", null);
		session.setAttribute("employee", null);
		return "login.jsp";
	}
}
